var arr = [
    {
        "name": "ZYTA",
        "age": "Y13xG_4wQnOWK1QwJLgg11d0pS4hewePU95UHtpMl3eE81uS74NC-6zu-Rtnw4Ix",
        "gender": "BBBBBB.doc"
    },
    [
        {
            "name": "ZYTX",
            "age": "Y13xG_4wQnOWK1QwJLgg11d0pS4hewePU95UHtpMl3eE81uS74NC-6zu-Rtnw4Ix",
            "gender": "AAAAAA.doc"
        },
        {
            "name": "ZYTX",
            "age": "Y13xG_4wQnOWK1QwJLgg11d0pS4hewePU95UHtpMl3eE81uS74NC-6zu-Rtnw4Ix",
            "gender": "AAAAAA.doc"
        },
        {
            "name": "ZYTA",
            "age": "Y13xG_4wQnOWK1QwJLgg11d0pS4hewePU95UHtpMl3eE81uS74NC-6zu-Rtnw4Ix",
            "gender": "AAAAAA.doc"
        }
    ],
    {
        "name": "ZDTX",
        "age": "Y13xG_4wQnOWK1QwJLgg11d0pS4hewePU95UHtpMl3eE81uS74NC-6zu-Rtnw4Ix",
        "gender": "CCCCCC.doc"
    }, 
    {
        "name": "ZYTX",
        "age": "Y13xG_4wQnOWK1QwJLgg11d0pS4hewePU95UHtpMl3eE81uS74NC-6zu-Rtnw4Ix",
        "gender": "AAAAAA.doc"
    },
    [
        {
            "name": "ZYTX",
            "age": "Y13xG_4wQnOWK1QwJLgg11d0pS4hewePU95UHtpMl3eE81uS74NC-6zu-Rtnw4Ix",
            "gender": "AAAAAA.doc"
        },
        {
            "name": "ZYTX",
            "age": "Y13xG_4wQnOWK1QwJLgg11d0pS4hewePU95UHtpMl3eE81uS74NC-6zu-Rtnw4Ix",
            "gender": "AAAAAA.doc"
        },
        {
            "name": "ZYTA",
            "age": "Y13xG_4wQnOWK1QwJLgg11d0pS4hewePU95UHtpMl3eE81uS74NC-6zu-Rtnw4Ix",
            "gender": "AAAAAA.doc"
        },
        {
            "name": "ZYTA",
            "age": "Y13xG_4wQnOWK1QwJLgg11d0pS4hewePU95UHtpMl3eE81uS74NC-6zu-Rtnw4Ix",
            "gender": "AAAAAA.doc"
        }
    ]
];

function uniqObjectArray(arr, key){
    function reducer(arr) {
        let hash = {};
        let newArray = arr.reduce((accumulator, currentValue, currentIndex) => {
            let isArr = Object.prototype.toString.call(currentValue) === '[object Array]'
            if (isArr) {
                return (accumulator.push(reducer(currentValue)), accumulator);
            }
            hash[currentValue[key]] ? '' : hash[currentValue[key]] = true && accumulator.push(currentValue);
            return accumulator
        }, [])
        return newArray
    }
    if (arr && arr.length) {
        let resultArr = reducer(arr)
        return [...new Set(resultArr)]
    }else{
        console.log('参数请输入数组.')
        return
    }
}

console.log(uniqObjectArray(arr,'name'))